1. Field of the Invention
The present invention relates generally to the field of graphics processing and more specifically to a system and method for controlling mode switches in hardware.
2. Description of the Related Art
A typical computing system includes a central processing unit (CPU), an input device, a system memory, one or more graphics processing units (GPUs), and one or more display devices. A variety of software application programs may run on the computing system. The CPU usually executes the overall structure of the software application program and configures the GPUs to perform specific tasks in the graphics pipeline (the collection of processing steps performed to transform 3-D scenes into 2-D images). Components within the GPUs then transmit the 2-D images through video connectors and video cables to drive the display devices.
The CPU typically configures the computing system to reflect a variety of display-related settings, such as the display resolution, the refresh rate, the pixel depth, and the type of display devices used for display purposes. As the CPU is executing, the user and the software application programs may request changes to one or more display-related settings. For example, a user may request a higher refresh rate for a display device. The CPU may then configure the computing system to reflect the changes to the display-related settings—a procedure known as a mode switch. A mode switch may include a variety of tasks to ensure a clean transition, such as disabling and enabling phase-locked loops (PLLs) and putting display devices into a blanked or a shutdown level of operation.
In one approach to implementing a mode switch, various software programs, such as the operating system, the display driver, and the resource manager, determine and execute the sequence of register accesses required to implement the mode switch. The software includes hardware-specific details to determine which registers need to be programmed, the correct sequence in which to program the registers, and the time required between types of changes, such as the time required after changing the frequency of a PLL before unblanking an associated display device. One drawback to this approach is that implementing such hardware-specific functionality in software has proven to be complicated and error-prone. Moreover, if the hardware design is ever modified, then the software usually needs to be updated to reflect the new hardware design. In addition, each mode switch may include numerous time-consuming software-hardware related interactions, decreasing overall system efficiency.
Another drawback is that the software may not fully appreciate the limitations of the hardware and, therefore, may schedule a sequence of changes that overburden the hardware. For example, suppose there are two display devices in the computing system that share the local memory, and the computing system is using the entire local memory bandwidth. Suppose further that the user requests a change in the display resolution of one of the display devices from 1280-by-1024 pixels to 1900-by-1200 pixels and a simultaneous change in the display resolution of the other display device from 1900-by-1200 pixels to 1280-by-1024 pixels. If the software does not accurately reflect the limitations of the hardware, such as the limited local memory bandwidth, then the sequence of tasks that the software orchestrates to accomplish the mode switch may inadvertently cause the computing system to pass through a transient mode where the display resolution of both of the displays may be set to 1900-by-1200 pixels. Consequently, the local memory bandwidth may be exceeded, and the data sent to the display devices may become corrupted.
As the foregoing illustrates, what is needed in the art is a more effective technique for controlling and executing mode switches.